package com.icoolkj.ms.system.controller;

import com.icoolkj.ms.api.auth.bo.UserInfoInTokenBO;
import com.icoolkj.ms.common.core.response.ServerResponseEntity;
import com.icoolkj.ms.common.core.utils.BeanUtil;
import com.icoolkj.ms.common.security.AuthUserContext;
import com.icoolkj.ms.system.vo.SysUserVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author icoolkj
 * @version 1.0
 * @description
 * @createDate 2025/02/17 18:08
 */
@RestController
public class SysUserController {

    @GetMapping("getInfo")
    public ServerResponseEntity<SysUserVO> getInfo()
    {
        UserInfoInTokenBO userInfoInTokenBO = AuthUserContext.get();
        return ServerResponseEntity.success(BeanUtil.map(userInfoInTokenBO, SysUserVO.class));
    }

}
